package com.day16.ex09;

import java.util.ArrayList;
import java.util.Collections;

public class PokerDemo {
    public static void main(String[] args) {
        ArrayList<String>array=new ArrayList<String>();
        String[] colors={"♥","♦","♣","♠"};
        String[] numbers={"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
        for(String color:colors){
            for(String number:numbers){
                array.add(color+number);
            }
        }
        array.add("大王");
        array.add("小王");
        Collections.shuffle(array);
        ArrayList<String>lqxArray=new ArrayList<String>();
        ArrayList<String>lyArray=new ArrayList<String>();
        ArrayList<String>fqyArray=new ArrayList<String>();
        ArrayList<String>dpArray=new ArrayList<String>();
        for (int i = 0; i < array.size(); i++) {
            String poker=array.get(i);
            if(i>=array.size()-3){
                dpArray.add(poker);
            } else if (i%3==0) {
                lqxArray.add(poker);
            } else if (i%3==1) {
                lyArray.add(poker);
            } else if (i%3==2) {
                fqyArray.add(poker);
            }
        }
        lookPoker("刘庆祥",lqxArray);
        lookPoker("李阳",lyArray);
        lookPoker("范庆勇",fqyArray);
        lookPoker("底牌",dpArray);
        lookPoker("底牌",dpArray);

    }
    public static void lookPoker(String name,ArrayList<String>array){
        System.out.print(name+"的牌是：");
        for (String poker : array){
            System.out.print(poker+" ");
        }
        System.out.println();
    }
}
